package org.wtframework.website.server.model.impl;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;
import org.openredhead.springx.core.server.model.IBasicObject;
import org.openredhead.springx.core.server.model.ICompositorObject;

@Entity
@Proxy(lazy = true)
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
@Table(name = "lz_website_link_man")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class LinkMan implements IBasicObject, ICompositorObject<Integer> {
	



	/**联系人
	 * 
	 */
	private static final long serialVersionUID = -1414101091697882883L;

	private Integer id;
	
	private Integer orderId;
	
	private Long userId;
		
	private Long linkManId;
	
	private String linkName; //联系人用户名
	
	private String linkNickName; //联系人昵称
	
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	

	
	@Override
	public int hashCode() {

		return (getId() != null ? getId().hashCode() : 0);

	}

	@Column(name = "order_id")
	public Integer getOrderId() {
		return orderId;
	}

	public void setOrderId(Integer orderId) {
		this.orderId = orderId;
	}

	@Column(name = "user_id")
	public Long getUserId() {
		return userId;
	}
	
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	
	@Column(name = "link_man_id")
	public Long getLinkManId() {
		return linkManId;
	}
	
	public void setLinkManId(Long linkManId) {
		this.linkManId = linkManId;
	}
	
	@Column(name = "link_name")
	public String getLinkName() {
		return linkName;
	}
	
	public void setLinkName(String linkName) {
		this.linkName = linkName;
	}
	
	@Column(name = "link_nick_name")
	public String getLinkNickName() {
		return linkNickName;
	}
	
	public void setLinkNickName(String linkNickName) {
		this.linkNickName = linkNickName;
	}
	@Override
	public boolean equals(Object o) {

		if (o == null) return false;

		if (!(o instanceof LinkMan)) return false;

		final LinkMan instance = (LinkMan) o;

		if (getId() != null ? !getId().equals(instance.getId()) : instance.getId() != null) return false;

		return true;

	}




}
